import http from '@/utils/http/axios'

enum Api {
    deptSelectbyName = '/dept/selectbyName',
    deptAll = '/dept/all',
    deptCreate = '/dept/create',
    deptUpdate = '/dept/update',
    deptDelete = '/dept/delete',
    deptSelectDeplist = '/dept/selectDeplist',
}

/**
 * @description: 获取部门列表
 */
export function deptSelectDeplist(params: any) {
    return http.request({
        url: Api.deptSelectDeplist,
        method: 'GET',
        params,
    }, {
        isTransformRequestResult: false
    })
}

/**
 * @description: 删除部门
 */
export function deptDelete(params: any) {
    return http.request({
        url: Api.deptDelete,
        method: 'POST',
        params,
    }, {
        isTransformRequestResult: false
    })
}

/**
 * @description: 编辑部门
 */
export function deptUpdate(params: any) {
    return http.request({
        url: Api.deptUpdate,
        method: 'POST',
        params,
    })
}

/**
 * @description: 添加部门
 */
export function deptCreate(params: any) {
    return http.request({
        url: Api.deptCreate,
        method: 'POST',
        params,
    })
}

/**
 * @description: 获取跟节点
 */
export function deptSelectbyName(params: any) {
    return http.request({
        url: Api.deptSelectbyName,
        method: 'GET',
        params,
    })
}

/**
 * @description: 获取跟节点
 */
export function deptAll(params: any) {
    return http.request({
        url: Api.deptAll,
        method: 'GET',
        params,
    }, {
        isTransformRequestResult: false
    })
}
